import request from "@/api/request";
import { ApiConfig } from "@/type/tablePage";
import { SysConfigDto, SysConfigUpdDto } from "@/type/sysConfig";

export const sysConfigApi: ApiConfig<SysConfigDto, SysConfigUpdDto> = {
    /**
     * 分页查询
     * @param params
     */
    selectList: (params) => request({
        url: '/sys-config',
        method: 'GET',
        params: params
    }),
    /**
     * 查询所有
     * @param params
     */
    selectAll: (params) => request({
        url: '/sys-config/all',
        method: 'GET',
        params: params
    }),
    /**
     * 查询单个
     * @param id
     */
    selectById: (id) => request({
        url: `/sys-config/${id}`,
        method: 'GET'
    }),
    /**
     * 查询多个
     * @param ids
     */
    selectByIds: (ids) => request({
        url: `/sys-config/ids`,
        method: 'GET',
        params: ids
    }),
    /**
     * 新增
     * @param obj
     */
    insertOne: (obj) => request({
        url: '/sys-config',
        method: 'POST',
        data: obj
    }),
    /**
     * 修改
     * @param obj
     */
    updateOne: (obj) => request({
        url: '/sys-config',
        method: 'PUT',
        data: obj
    }),
    /**
     * 新增多个
     * @param objs
     */
    insertMore: (objs) => request({
        url: '/sys-config/s',
        method: 'POST',
        data: objs
    }),
    /**
     * 修改多个
     * @param objs
     */
    updateMore: (objs) => request({
        url: '/sys-config/s',
        method: 'PUT',
        data: objs
    }),
    /**
     * 删除
     * @param ids
     */
    deleteList: (...ids) => request({
        url: '/sys-config',
        method: 'DELETE',
        data: ids
    })
}
